package com.lvmama.pangolin.service.impl;


import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lvmama.pangolin.entity.ProductConditionVO;
import com.lvmama.pangolin.entity.RelevanceProduct;
import com.lvmama.pangolin.entity.link.TicketProductLinkView;
import com.lvmama.pangolin.mybatis.mapper.RelevanceProductMapper;
import com.lvmama.pangolin.service.RelevanceProductService;

@Transactional
@Service
public class RelevanceProductServiceImpl implements RelevanceProductService{
	@Autowired
	private RelevanceProductMapper revelenceProductMapper;

	@Override
	public void insertXC(RelevanceProduct product) {
		revelenceProductMapper.insertXC(product);
		
	}

	@Override
	public void insertTN(RelevanceProduct product) {
		revelenceProductMapper.insertTN(product);
		
	}

	@Override
	public void insertTC(RelevanceProduct product) {
		revelenceProductMapper.insertTC(product);
		
	}

	@Override
	public void insertQNR(RelevanceProduct product) {
		revelenceProductMapper.insertQNR(product);
		
	}

	@Override
	public void deleteXC(RelevanceProduct product) {
		revelenceProductMapper.deleteXC(product);
		
	}

	@Override
	public void deleteTN(RelevanceProduct product) {
		revelenceProductMapper.deleteTN(product);
		
	}

	@Override
	public void deleteTC(RelevanceProduct product) {
		revelenceProductMapper.deleteTC(product);
		
	}

	@Override
	public void deleteQNR(RelevanceProduct product) {
		revelenceProductMapper.deleteQNR(product);
		
	}

	@Override
	public void updateXC(RelevanceProduct product) {
		revelenceProductMapper.updateXC(product);
		
	}

	@Override
	public void updateTN(RelevanceProduct product) {
		revelenceProductMapper.updateTN(product);
		
	}
	//新增美团
	@Override
	public void insertMT(RelevanceProduct product) {
		revelenceProductMapper.insertMT(product);
	}
	//新增美团
	@Override
	public void deleteMT(RelevanceProduct product) {
		revelenceProductMapper.deleteMT(product);
	}
	//新增美团
	@Override
	public void updateMT(RelevanceProduct product) {
		revelenceProductMapper.updateMT(product);
	}

	@Override
	public void updateTC(RelevanceProduct product) {
		revelenceProductMapper.updateTC(product);
		
	}

	@Override
	public void updateQNR(RelevanceProduct product) {
		revelenceProductMapper.updateQNR(product);
		
	}

	@Override
	public RelevanceProduct viewRelevance(String productId,String businessCode) {
		
		return revelenceProductMapper.viewRelevance(productId,businessCode);
	}

	@Override
	public PageInfo<RelevanceProduct> viewAllRelevance(ProductConditionVO po) {
		PageHelper.startPage(po.getPage(), po.getPageSize());
		List<RelevanceProduct>  list=revelenceProductMapper.viewAllRelevance(po);
		PageInfo<RelevanceProduct> page=new PageInfo<RelevanceProduct>(list);
		return page;
	}

	@Override
	public List<RelevanceProduct> viewAllRelevance() {
		// TODO Auto-generated method stub
		return revelenceProductMapper.allRelevance();
	}

	@Override
	public void insertEL(RelevanceProduct product) {
		// TODO Auto-generated method stub
		revelenceProductMapper.insertEL(product);
	}

	@Override
	public List<RelevanceProduct> viewAllRelevanceWithPCVO(ProductConditionVO po) {
		List<RelevanceProduct>  list=revelenceProductMapper.viewAllRelevance(po);
		return list;
	}

	@Override
	public void deleteEL(RelevanceProduct product) {
		revelenceProductMapper.deleteEL(product);
		
	}

	@Override
	public void updateEL(RelevanceProduct product) {
		revelenceProductMapper.updateEL(product);
		
	}

	@Override
	public List<RelevanceProduct> findByMap(Map<String, String> paramMap) {
		return revelenceProductMapper.findByMap(paramMap);
	}

	@Override
	public List<String> findNameByRelProdId(String businessCode,String companyCode, String prodIdRel) {
		return revelenceProductMapper.findNameByRelProdId(businessCode,companyCode, prodIdRel);
	}

	@Override
	public void updateRelevance(RelevanceProduct product) {
		revelenceProductMapper.updateRelevance(product);
	}

}
